import os
import subprocess

pack_command=''

pack_command=os.environ["Pack_Command"]
print(f"Pack_Command: {pack_command}")

def delete_file(file_path):
    try:
        os.remove(file_path)
        print("del success")
    except OSError as e:
        print(f"del: {e}")

print("------------begin build----------------")
# command = 'npm config -g set registry http://nexus.supcon.com/repository/npm-proxy/'
# command0 = 'yarn config set registry http://nexus.supcon.com/repository/npm-proxy/'
# command1 = 'yarn config set electron_mirror http://nexus.supcon.com/repository/electron-proxy-raw/'
# command2 = 'yarn config set electron_builder_binaries_mirror http://nexus.supcon.com/repository/electron-builder-proxy-raw/'
# command = 'yarn config set proxy http://nexus.supcon.com/repository/npm-proxy/'

# command1 = 'yarn config set https-proxy http://nexus.supcon.com/repository/npm-proxy/'
command3 = pack_command

#delete_file("yarn.lock")
# subprocess.run(command, shell=True)
# subprocess.run(command1, shell=True)
subprocess.run(command3, shell=True)

print("------------end build----------------")
